﻿<%@ Page Title="Create a new Vacancy" Language="C#" MasterPageFile="~/Employee/MasterPageEmployee.master" AutoEventWireup="true" CodeFile="CreateVacancy.aspx.cs" Inherits="Employee_CreateVacancy" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link rel="Stylesheet" href="Styles/EmployeeStyleSheet.css" type="text/css" />
    <script type="text/javascript" src="../Scripts/jquery.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#<%=ddlTypeJob.ClientID %>').blur(function () {
                if ($('#<%=ddlTypeJob.ClientID %>').val() == "Please choise Type of work") {
                    $('#<%=lblTypeofworkError.ClientID %>').html("(*)");
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else {
                    $('#<%=lblTypeofworkError.ClientID %>').html("");
                    $('#<%=btnCreate.ClientID %>').attr('disabled', false);
                }
            });
            $('#<%=txtDecription.ClientID %>').blur(function () {
                if ($('#<%=txtDecription.ClientID %>').val() == "") {
                    $('#<%=lblDescriptError.ClientID %>').html("(*)");
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else {
                    $('#<%=lblDescriptError.ClientID %>').html("");
                    $('#<%=btnCreate.ClientID %>').attr('disabled', false);
                }
            });
            $('#<%=txtNumberofJob.ClientID %>').blur(function () {
                if ($('#<%=txtNumberofJob.ClientID %>').val() == "") {
                    $('#<%=lblNumber.ClientID %>').html("(*)");
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else {
                    $('#<%=lblNumber.ClientID %>').html("");
                    $('#<%=btnCreate.ClientID %>').attr('disabled', false);
                }
            });
            $('#<%=txtDateFilfilled.ClientID %>').blur(function () {
                if ($('#<%=txtDateFilfilled.ClientID %>').val() == "") {
                    $('#<%=lblDateError.ClientID %>').html("(*)");
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else {
                    $('#<%=lblDateError.ClientID %>').html("");
                    $('#<%=btnCreate.ClientID %>').attr('disabled', false);
                }
            });
            $('#<%=txtTitle.ClientID %>').blur(function () {
                if ($('#<%=txtTitle.ClientID %>').val() == "") {
                    $('#<%=lblTitleError.ClientID %>').html("(*)");
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else {
                    $('#<%=lblTitleError.ClientID %>').html("");
                    $('#<%=btnCreate.ClientID %>').attr('disabled', false);
                }
            });
            $('#<%=txtDateFilfilled.ClientID %>').click(function () {
                $('#DivCalendar').fadeIn(200);
            });
            $('#<%=txtDateFilfilled.ClientID %>').change(function () {
                $('#DivCalendar').fadeOut(200);
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceholder" Runat="Server">
    <div id="MainCreateVacancy">
        <h2>Create a new Vacancy</h2>
        <p>
            <asp:Label ID="lblTypeOfWork" runat="server" Text="Type of work:" Height="20px" 
                Width="180px"></asp:Label>
            <asp:DropDownList ID="ddlTypeJob" runat="server" 
                CssClass="CVinput" Height="20px" Width="204px">
                <asp:ListItem Selected="True">Please choise Type of work</asp:ListItem>
            </asp:DropDownList>
            <asp:Label ID="lblTypeofworkError" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblTitle" runat="server" Text="Title Vacancy:" Height="20px" 
                Width="180px"></asp:Label>
            <asp:TextBox ID="txtTitle" runat="server" Width="200px"></asp:TextBox>
            <asp:Label ID="lblTitleError" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblDescription" runat="server" Text="Description:" Height="20px" 
                Width="180px"></asp:Label>
            <asp:TextBox ID="txtDecription" runat="server" TextMode="MultiLine" 
                CssClass="CVinput" Height="40px" Width="202px"></asp:TextBox>
            <asp:Label ID="lblDescriptError" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblNumberofJob" runat="server" Text="Number needed to hire:" 
                Height="20px" Width="180px"></asp:Label>
            <asp:TextBox ID="txtNumberofJob" runat="server" CssClass="CVinput" 
                Height="20px" Width="200px"></asp:TextBox>
            <asp:Label ID="lblNumber" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblDateCreation" runat="server" Text="Date Creation:" 
                Height="20px" Width="180px"></asp:Label>
            <asp:TextBox ID="txtDateCreation" runat="server" CssClass="CVinput" 
                Width="200px" Enabled="False"></asp:TextBox>
        </p>
        <p>
            <asp:Label ID="DateFylfilled" runat="server" Text="Date Fulfilled:" 
                Height="20px" Width="180px"></asp:Label>
            <asp:TextBox ID="txtDateFilfilled" runat="server" CssClass="CVinput" 
                Width="200px"></asp:TextBox>
            <asp:Label ID="lblDateError" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <div id="DivCalendar">
            <asp:Calendar ID="Calendar1" runat="server" 
                onselectionchanged="Calendar1_SelectionChanged" BackColor="White" 
                BorderColor="#3366CC" BorderWidth="1px" CellPadding="1" 
                DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" 
                ForeColor="#003399" Height="200px" Width="220px">
                <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
                <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
                <OtherMonthDayStyle ForeColor="#999999" />
                <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
                <TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" 
                    Font-Bold="True" Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
                <TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
                <WeekendDayStyle BackColor="#CCCCFF" Wrap="False" />
            </asp:Calendar>
        </div>
        <p>
            <asp:Label ID="lblStatus" runat="server" Text="Status:" Height="20px" 
                Width="180px"></asp:Label>
            <asp:DropDownList ID="ddlStatus" runat="server" CssClass="CVinput" 
                Height="20px" Width="100px" Enabled="False">
                <asp:ListItem Selected="True">On</asp:ListItem>
            </asp:DropDownList>
        </p>
        <p style="text-align: center;"><asp:Label ID="lblError" runat="server" Text="" ForeColor="Red"></asp:Label>
            <asp:Label ID="lblSuccess" runat="server" ForeColor="Blue"></asp:Label>
        </p>
        <p id="button">
            <asp:Button ID="btnCreate" runat="server" Text="Create" Height="30px" 
                Width="100px" onclick="btnCreate_Click" ToolTip="Create new Vacancy" />
            <asp:Button ID="btnClear" runat="server" Text="Clear" Height="30px" 
                Width="100px" onclick="btnClear_Click" ToolTip="Clear all textbox" />
        </p>
    </div>
</asp:Content>

